<?php
require_once('init.php');

$html = <<<EOT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>反馈订单</title>
<link rel="stylesheet" href="../common/style.css" type="text/css" />
</head>
<body>
EOT;

$cps360_order_mng = new Cps360Order();

$html .= '<div><a href="../">首页</a></div>';

$page = $_GET['page'] ? (int)$_GET['page'] : 0;
$size = $_GET['size'] ? (int)$_GET['size'] : 20;
$list = $cps360_order_mng->getList($page, $size);
$list = $cps360_order_mng->formatList($list);
if ($list) {
    $html .= '<table><thead>';
    $html .= '<th>反馈订单号</th>';
    $html .= '<th>订单号</th>';
    $html .= '<th>下单时间</th>';
    $html .= '<th>订单最后更新时间</th>';
    $html .= '<th>合作编号</th>';
    $html .= '<th>奇虎业务编号</th>';
    $html .= '<th>奇虎用户ID</th>';
    $html .= '<th>总佣金</th>';
    $html .= '<th>佣金明细</th>';
    $html .= '<th width="15%">商品详情</th>';
    $html .= '<th>服务费用</th>';
    $html .= '<th>订单金额</th>';
    $html .= '<th>优惠金额</th>';
    $html .= '<th>用户实际支付金额</th>';
    $html .= '<th>商家订单状态</th>';
    $html .= '<th width="10%">扩展字段</th>';
    $html .= '<th>反馈时间</th>';
    $html .= '<th>反馈状态</th>';
    $html .= '<th width="5%">操作</th>';
    $html .= '</thead>';
    foreach ($list as $row) {
        $html .= '<tr>';
        $html .= '<td>' . $row['id'] . '</td>';
        $html .= '<td>' . $row['order_id'] . '</td>';
        $html .= '<td>' . $row['order_time'] . '</td>';
        $html .= '<td>' . $row['order_updtime'] . '</td>';
        $html .= '<td>' . $row['bid'] . '</td>';
        $html .= '<td>' . $row['qihoo_id'] . '</td>';
        $html .= '<td>' . $row['qid'] . '</td>';
        $html .= '<td>￥' . $row['total_comm'] . '</td>';
        $html .= '<td>' . $row['commission'] . '</td>';
        $html .= '<td>' . $row['p_info'] . '</td>';
        $html .= '<td>￥' . $row['server_price'] . '</td>';
        $html .= '<td>￥' . $row['order_price'] . '</td>';
        $html .= '<td>￥' . $row['coupon'] . '</td>';
        $html .= '<td>￥' . $row['total_price'] . '</td>';
        $html .= '<td>' . $row['status'] . '</td>';
        $html .= '<td>' . $row['ext'] . '</td>';
        $html .= '<td>' . date("Y-m-d H:i:s", $row['active_time']) . '</td>';
        $html .= '<td>' . $row['active_status'] . '</td>';
        $html .= '<td><a href="orderFeedback.php?id=' . $row['id'] . '">反馈</a></td>';
        $html .= '</tr>';
    }
    $html .= '</table>';
} else {
    $html .= '<br/>没有反馈订单！';
}

$html .= <<<EOT
</body>
</html>
EOT;

echo $html;
?>
